Skip to content

fix(QUAL-009): bring app.py into the coverage gate - #123

Open
DoRmAmMu1997 wants to merge 1 commit into
mainfrom
fix/qual-009-app-py-coverage
Open

fix(QUAL-009): bring app.py into the coverage gate#123
DoRmAmMu1997 wants to merge 1 commit into
mainfrom
fix/qual-009-app-py-coverage

Conversation

@DoRmAmMu1997

Copy link
Copy Markdown
Owner

Closes #120.

Problem

The gate measured --cov=backend --cov=screeners --cov=ui, so the 927-line Streamlit entrypoint contributed nothing to the 89% floor — despite roughly 14 tests/test_app_*.py modules actively exercising it. Coverage could regress in app.py without CI noticing, which is the exact failure the floor exists to prevent.

The floor did not need re-baselining

This is the useful finding, and it is why the diff is small:

Statements Missed Coverage
app.py alone 290 69 76%
Total, before 16,297 1,634 89.97%
Total, after 16,587 1,706 89.71%

89.71% still clears the 89 floor with 0.71pp of headroom — which matches the "~0.7pp" figure AGENTS.md already documents. So the floor number is untouched, and this PR is one flag in six files rather than a floor change nobody asked for.

(Amusingly, AGENTS.md claimed "measured ~89.7%" while the real figure was 89.97%. Including app.py makes that sentence accurate again.)

Note on the spelling

--cov=app.py makes pytest-cov abort outright. The module name --cov=app is what works, and is what landed.

Files kept in sync

Per AGENTS.md §7, changing a CI command means co-updating everything that mirrors it, in the same commit:

  • .github/workflows/quality-and-security.yml:52
  • AGENTS.md §6, README.md, docs/operations.md, docs/adding-a-screener.md
  • all three assertions in tests/test_supply_chain_policy.py (the CI_COMMANDS tuple plus the workflow and README checks)

AGENTS.md also gains a short note on what is measured and what is not: Dependencies/ (an interactive credential helper) and migrations/ (hand-written, covered by the Alembic drift guard instead) stay out on purpose.

The three *-handoff.md docs still quote --cov-fail-under=84. Those are point-in-time ticket handoffs, so they are left as the historical record they are — same treatment as the audit register.

Deliberately not included

The --strict-markers rider I suggested on the issue. Its premise was "if a [tool.coverage.run] section is being added anyway" — it is not, because --cov=app needs no coverage config at all. Keeping pyproject.toml untouched preserves the empty §7 pin diff for this branch. It is worth its own small ticket: there is still no [tool.pytest.ini_options], so a typo'd @pytest.mark.slwo would silently do nothing.

Verification

  • pytest -q --cov=app --cov=backend --cov=screeners --cov=ui --cov-fail-under=89 — 2034 passed, 1 skipped, 89.71%
  • ruff check, compileall — clean
  • tests/test_supply_chain_policy.py — 13 passed against the new command strings
  • git diff origin/main HEAD -- constraints.txt pyproject.toml — empty

🤖 Generated with Claude Code

The gate measured `--cov=backend --cov=screeners --cov=ui`, so the 927-line
Streamlit entrypoint contributed nothing to the 89% floor even though ~14
tests/test_app_*.py modules exercise it. Coverage could regress in app.py
without CI noticing - the exact failure the floor exists to prevent.

Add `--cov=app` to the command. Note the spelling: `--cov=app.py` makes
pytest-cov abort, so the module name is what works.

The floor did NOT need re-baselining. app.py measures 76% (290 statements, 69
missed) and pulls the total from 89.97% to 89.71%, which still clears 89 with
0.71pp of headroom - matching the "~0.7pp" figure AGENTS.md already documents.
Leaving the number alone also keeps this diff to one flag in six files rather
than a floor change nobody asked for.

Per AGENTS.md section 7, the command string is updated in every place that
mirrors it - the workflow, AGENTS.md, README.md, docs/operations.md,
docs/adding-a-screener.md - and in all three assertions in
tests/test_supply_chain_policy.py, in the same commit.

The three *-handoff.md docs still quote `--cov-fail-under=84`. Those are
point-in-time ticket handoffs, so they are left as the historical record they
are, exactly like the audit register.

Deliberately NOT included: the `--strict-markers` rider suggested on the issue.
Its premise was "if a [tool.coverage.run] section is being added anyway" - it is
not, because `--cov=app` needs no coverage config. Keeping pyproject.toml
untouched preserves the empty section-7 pin diff for this branch. Worth its own
small ticket.

Closes #120

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
DoRmAmMu1997 added a commit that referenced this pull request Sep 4, 2026
OBS-004 (#119/#124), QUAL-009 (#120/#123) and SEC-004 (#121/#122) were filed and
built immediately after the audit, so the register should not describe them as
untouched. The remaining entries stay as recorded findings.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QUAL-009: bring app.py into the coverage gate and re-baseline the floor

1 participant